Introduction

[~ 200 words]

An unidentified flying object (UFO), recently renamed as a UAP (unidentified aerial phenomenon) is any perceived aerial phenomenon that cannot be immediately identified or explained. There have been several studies of UAPs carried out by various US government agencies, including a Pentagon report that was declassified in June 2021. The US House of Representatives recently voted to encourage the sharing of more UFO sightings by adopting a bipartisan amendment to the National Defense Authorization Act. The aim of this study is to create a map depicting the number of sightings of UAP per state and identify if there is a cluster of UAP sightings.

Clearly stated background and questions / hypotheses / problems being addressed. Sets up the analysis in an interesting and compelling way.

Materials and methods

[~ 200 words]

Narrative: Clear narrative description of the data sources and methods. Includes data from at least two sources that were integrated / merged in R.

Point locations of UAP/UFO sightings were from the National UFO Reporting Center. National UFO Reporting Center was founded in 1974 and has documented approximately 90,000 reported UFO sightings over its history mostly in the United States.

The R Package ‘usmap’ was also used to obtain a contiguous map of United States.

Code: The code associated with the project is well organized and easy to follow. Demonstrates mastery of R graphics and functions.

Data: The underlying data are publicly accessible via the web and downloaded/accessed within the Rmd script. If you want to use your own data, you must make it available on a website (e.g. Figshare) so that others are able to re-run your code.

You can do bullets like this:

  • The first most important thing
  • The second most important thing
  • The third most important thing

You can do numbers like this:

  1. The first most important thing
  2. The second most important thing
  3. The third most important thing

See http://rmarkdown.rstudio.com/ for all the amazing things you can do.

Here’s my first code chunk.

Load any required packages in a code chunk (you may need to install some packages):

library(tidyverse)
library(leaflet)
library(htmltools)
library(tigris)
library(maptools)
library(spdep)
library(sf)
library(lubridate)
library(viridis)
knitr::opts_chunk$set(cache=TRUE)  # cache the results for quick compiling

Download and clean all required data

ufo = read_csv('https://query.data.world/s/6xru2x6vjkjgz5ck52invxt3j7mc5w')

US_map = states(cb = T)
## 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |                                                                      |   1%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==============                                                        |  21%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |======================================================================| 100%
US_map = as(US_map, 'sf')
US_map = states(cb = T)
US_map = as(US_map, 'sf')
us_states = c('AL', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL',
              'GA', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA',
              'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE',
              'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK',
              'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT',
              'VA', 'WA', 'WV', 'WI', 'WY', 'DC')

US_map = US_map %>% filter(STUSPS %in% us_states)

Add any additional processing steps here.

Results

[~200 words]

Tables and figures (maps and other graphics) are carefully planned to convey the results of your analysis. Intense exploration and evidence of many trials and failures. The author looked at the data in many different ways before coming to the final presentation of the data.

Show tables, plots, etc. and describe them.

US_ufo = ufo %>% filter(state %in% us_states) %>% group_by(state) %>% summarize(n = n()) 

US_map = left_join(US_map, US_ufo, by = c("STUSPS" = 'state'))

US_map %>% 
  ggplot() +
  geom_col(aes(x = fct_reorder(STUSPS, n), y = n)) + coord_flip() +
  theme_light() +
  labs(x = 'Number of UFOs', y = 'State') +
  geom_text(aes(x = fct_reorder(STUSPS, n), y = n, label = n), nudge_y = 350, size = 3.5) +
  ggtitle('Number of UFOs per State')
Map of completely random data

Map of completely random data

ufo$year = year(ufo$date_time)
ufo %>% select(year, state) %>%  na.omit() %>% 
  group_by(year, state) %>% 
  summarize(n = n()) %>% ungroup() %>% 
  group_by(year) %>% summarize(tot_ufos = sum(n)) %>% 
  ggplot() +
  geom_line(aes(x = year, y = tot_ufos)) +
  geom_point(aes(x = year, y = tot_ufos)) +
  theme_light() +
  labs(x = 'Year', y = 'UFO sightings') + 
  ggtitle('UFO sightings in the USA from 1969 to 2022') +
  scale_x_continuous(breaks = seq(1969, 2022, 5))
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.

ufo %>% select(year, state) %>%  na.omit() %>% 
  filter(state %in% us_states[1:10]) %>% 
  group_by(year, state) %>% 
  summarize(n = n()) %>% ungroup() %>% 
  group_by(year, state) %>% summarize(tot_ufos = sum(n)) %>% 
  ggplot() +
  geom_line(aes(x = year, y = tot_ufos, color = state)) +
  geom_point(aes(x = year, y = tot_ufos, color = state)) +
  theme_light() +
  labs(x = 'Year', y = 'UFO sightings') + 
  ggtitle('UFO sightings in the USA from 1969 to 2022') +
  scale_x_continuous(breaks = seq(1969, 2022, 5)) +
  scale_color_discrete(name = 'State') + ylim(0, 900)
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.

ufo %>% select(year, state) %>%  na.omit() %>% 
  filter(state %in% us_states[11:20]) %>% 
  group_by(year, state) %>% 
  summarize(n = n()) %>% ungroup() %>% 
  group_by(year, state) %>% summarize(tot_ufos = sum(n)) %>% 
  ggplot() +
  geom_line(aes(x = year, y = tot_ufos, color = state)) +
  geom_point(aes(x = year, y = tot_ufos, color = state)) +
  theme_light() +
  labs(x = 'Year', y = 'UFO sightings') + 
  ggtitle('UFO sightings in the USA from 1969 to 2022') +
  scale_x_continuous(breaks = seq(1969, 2022, 5)) + 
  scale_color_discrete(name = 'State') + ylim(0, 900)
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.

ufo %>% select(year, state) %>%  na.omit() %>% 
  filter(state %in% us_states[21:30]) %>% 
  group_by(year, state) %>% 
  summarize(n = n()) %>% ungroup() %>% 
  group_by(year, state) %>% summarize(tot_ufos = sum(n)) %>% 
  ggplot() +
  geom_line(aes(x = year, y = tot_ufos, color = state)) +
  geom_point(aes(x = year, y = tot_ufos, color = state)) +
  theme_light() +
  labs(x = 'Year', y = 'UFO sightings') + 
  ggtitle('UFO sightings in the USA from 1969 to 2022') +
  scale_x_continuous(breaks = seq(1969, 2022, 5)) + 
  scale_color_discrete(name = 'State') + ylim(0, 900)
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.

ufo %>% select(year, state) %>%  na.omit() %>% 
  filter(state %in% us_states[31:40]) %>% 
  group_by(year, state) %>% 
  summarize(n = n()) %>% ungroup() %>% 
  group_by(year, state) %>% summarize(tot_ufos = sum(n)) %>% 
  ggplot() +
  geom_line(aes(x = year, y = tot_ufos, color = state)) +
  geom_point(aes(x = year, y = tot_ufos, color = state)) +
  theme_light() +
  labs(x = 'Year', y = 'UFO sightings') + 
  ggtitle('UFO sightings in the USA from 1969 to 2022') +
  scale_x_continuous(breaks = seq(1969, 2022, 5)) + 
  scale_color_discrete(name = 'State') + ylim(0, 900)
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.

ufo %>% select(year, state) %>%  na.omit() %>% 
  filter(state %in% us_states[41:49]) %>% 
  group_by(year, state) %>% 
  summarize(n = n()) %>% ungroup() %>% 
  group_by(year, state) %>% summarize(tot_ufos = sum(n)) %>% 
  ggplot() +
  geom_line(aes(x = year, y = tot_ufos, color = state)) +
  geom_point(aes(x = year, y = tot_ufos, color = state)) +
  theme_light() +
  labs(x = 'Year', y = 'UFO sightings') + 
  ggtitle('UFO sightings in the USA from 1969 to 2022') +
  scale_x_continuous(breaks = seq(1969, 2022, 5)) + 
  scale_color_discrete(name = 'State') + ylim(0, 900)
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'year'. You can override using the
## `.groups` argument.

US_map_nb = poly2nb(US_map)
US_map_listw = nb2listw(US_map_nb)

US_coords = coordinates(as_Spatial(US_map)) %>% data.frame()

neighborhood = as(spdep::nb2lines(US_map_nb, coords = coordinates(as_Spatial(US_map))), 'sf')
## Warning in CRS(proj4string): CRS: projargs should not be NULL; set to NA
neighborhood = sf::st_set_crs(neighborhood, sf::st_crs(US_map))

ggplot(US_map) +
  geom_sf(size = 1, color = 'gray', fill = 'white') +
  geom_sf(data = neighborhood) +
  geom_point(data = US_coords, aes(x = X1, y = X2), color = 'red') +
  theme_light() +
  ggtitle('Contiguous US neighborhood structure')

labels <- sprintf(
  "<strong>%s</strong><br/>%g ufos",
  US_map$NAME, US_map$n
) %>% lapply(htmltools::HTML)

pal = colorBin('YlOrRd', domain = US_map$n, bins = quantile(US_map$n, c(seq(0,0.9, by = 0.1125), 1)))

leaflet(US_map) %>% 
  addPolygons(
    fillColor = ~pal(n),
    fillOpacity = 1, 
    color = 'white',
    weight = 2,
    label = labels,
    highlight = highlightOptions(
      weight = 4,
      color = 'black',
      fillOpacity = 1,
      bringToFront = TRUE)) %>%
  addProviderTiles(providers$Esri.WorldStreetMap) %>% 
  addLegend(pal = pal, values = ~n, opacity = 0.7, title = 'UFO Sightings: 1969 - 2022',
            position = "bottomright")
## Warning: sf layer has inconsistent datum (+proj=longlat +datum=NAD83 +no_defs).
## Need '+proj=longlat +datum=WGS84'
moran.mc(US_map$n, listw = US_map_listw, nsim = 9999)
## 
##  Monte-Carlo simulation of Moran I
## 
## data:  US_map$n 
## weights: US_map_listw  
## number of simulations + 1: 10000 
## 
## statistic = 0.082942, observed rank = 8855, p-value = 0.1145
## alternative hypothesis: greater

Conclusions

[~200 words]

Clear summary adequately describing the results and putting them in context. Discussion of further questions and ways to continue investigation.

References

All sources are cited in a consistent manner